<template>
  <div class="login-container">
    <div class="top_container">
      <div class="nav-bar-block">
        <div class="bar-block-left">
          <a class="block-left-link" @click="$router.push('/')"></a>
        </div>
        <div class="bar-block-right" @click="changeState">
          <div class="border">
            <a class="right-before-link" data-id="login">登录</a>
            <span style="color: #fff;">/</span>
            <a class="right-before-link right-before-link--active" data-id="register">注册</a>
          </div>
        </div>
      </div>
    </div>
    <div class="container-content">
      <components :is="showWihch" @showForgot="showForgot" />
    </div>
  </div>
</template>

<script>
import forgotPassword from './components/forgotPassword.vue'
import login from './components/login.vue'
import register from './components/register.vue'
export default {
  name: 'Login',
  components: {
    register, forgotPassword, login
  },
  data() {

    return {
      showWihch: 'login',
      loginOrRegister: 'forgotPassword',
    }
  },

  created() {
    this.showWihch = this.$route.params.register ? this.$route.params.register : 'login'
  },
  mounted() {
  },
  destroyed() {

  },
  methods: {
    changeState(e) {
      if (e) {
        this.showWihch = e.target.dataset.id === "login" ? 'login' : 'register'
      }
    },
    showForgot(value) {
      this.showWihch = value
    }
  }
}
</script>

<style lang="scss" scoped>
@import "~@/styles/variables.scss";
$bg: #fff;



.login-container {
  position: relative;
  min-height: 100%;
  height: 100%;
  width: 100%;
  // background: linear-gradient(90deg,$themeTopToolColor,$themeTopToolColor);
  background-color: $themeMainColor !important;
  background: url(../../assets/login.png) no-repeat ;
  background-size: cover;
  overflow: hidden;

  .top_container {
    // background-color: $themeTopToolColor;
    padding: 0 80px;
    // .router_link{
    //   color: $bg;
    //   span{
    //     margin: 0 25px;
    //     cursor: pointer;
    //   }
    // }
  }

  .bar-block-right {
    display: flex;
    align-items: center;

    a:hover {
      font-size: 20px;
    }

    .border {
      text-align: center;
      width: 140px;
      height: 35px;
      line-height: 35px;
      border-radius: 15px;
      border: 1px solid #fff;
    }
  }

  .nav-bar-block {
    display: flex;
    width: 90%;
    height: 60px;
    line-height: 60px;
    margin: 0 auto;
    justify-content: space-between;

    .right-before-link {
      padding: 5px 12px;
      color: $bg;
      // &.right-before-link--active{
      //   border: 1px solid $bg;
      //   border-radius: 3px;
      // }
    }
  }



}

// ui
::v-deep .el-tabs__nav-scroll {
  display: flex;
  justify-content: space-around;

  .el-tabs__item {
    color: #999;
    font-size: 18px !important;
    height: 50px;
    width: 175px;
    text-align: center;

    &.is-active {
      color: $themeTopToolColor;
      font-weight: 700;
    }
  }

  .el-tabs__active-bar {
    background-color: $themeTopToolColor;
  }
}

.container-content {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.block-left-link{
  display: inline-block;
  width: 200px;
  height: 80px;
  margin-top: 5px;
  // background-color: red;
  background: url(../../assets/logo.png) no-repeat 50%;
  background-size: 100% 100%;
}

</style>
